public class student {
    private String name;
    private String id;
    private double[] score;

    public student(String name, String id ){
        this.name = name;
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public boolean setScore(double score[]){
        for (int i = 0; i < 3; i++) {
            if(score[i] < 0 && score[i] > 100){
                return false;
            }
        }
        this.score = score;
        return true;
    }

    public double[] getScore() {
        return score;
    }

    public double sum(){
        return score[0] + score[1] + score[2];
    }
    public double average(){
        return sum()/3.0;
    }
    public double [] max_min(){
        double [] max_min=new double[2];
        double max=score[0];
        double min=score[0];
        for (int i=0;i<score.length;i++){
            if(score[i]>max){
                max=score[i];
            }
            if(score[i]<min){
                min=score[i];
            }
        }
        max_min[0]=max;
        max_min[1]=min;
        return max_min;
    }
    public void printf(){
        double[] max_min = max_min();
        double sum = sum();
        double average = average();

        System.out.printf("成绩的总分为:%.2f\n平均分为:%.2f\n最高分为:%.2f\n最低分为:%.2f",sum,average,max_min[0],max_min[1]);
    }

}
